#include <iostream>
using namespace std;

// 99.17 %
class Solution
{
  public:
	bool isPowerOfFour(int num)
	{
		if (num <= 0)
			return false;
		while (num != 1)
		{
			if (num % 4 != 0)
				return false;
			num /= 4;
		}
		return true;
	}
};

int main()
{
	int num = 6;
	cout << Solution().isPowerOfFour(num) << endl;
	return 0;
}